﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="_test.aspx.cs" Inherits="test_test" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>
    <link href="../css/Selector.css" rel="stylesheet" type="text/css" />
    <link href="../css/theme/jquery-ui-1.7.2.custom.css" rel="stylesheet" type="text/css" />
    <link href="../css/ui.jqgrid.css" rel="stylesheet" type="text/css" />
    <link type="text/css" href="../css/theme/ui.all.css" media="screen" rel="stylesheet" />
    <link href="../css/bridging2.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" media="screen" href="../css/jqModal.css" />
    <link href="../css/jpage.css" rel="stylesheet" type="text/css" />

    <script src="../js/jquery-1.3.2.js" type="text/javascript"></script>

    <script src="../js/common.js" type="text/javascript"></script>

    <script src="../js/common.js" type="text/javascript"></script>

    <script src="../js/global.js" type="text/javascript"></script>

    <script src="../js/jqModal.js" type="text/javascript"></script>

    <script src="../js/jqDnR.js" type="text/javascript"></script>

    <script src="../js/onload.js" type="text/javascript"></script>

    <script type="text/javascript">
    $(document).ready(function() {
    $("#houseallot").jqm().jqDrag('.jqDrag');
//    $("#abc").click(function(){
       GetData("cd02a1fa-3250-4431-b485-c18354a11b7b")
       $("#houseallot").jqmShow();
//    });
    });
    
    //分配提交
function allotsubmit() {
    //进行验证

     if(!$("#txtOwnerNum").val().isNum())
     {
       alert("请输入数字");
       return ;
     }
      if(!$("#txtProtectedNum").val().isNum())
     {
       alert("请输入数字");
       return ;
     }
      if(!$("#txtLockHouseDay").val().isNum())
     {
       alert("请输入数字");
       return ;
     }
       if(!$("#txtMarkProtectHours").val().isNum())
     {
       alert("请输入数字");
       return ;
     }
            OwnerNum=$("#txtOwnerNum").val();
            HdeHouse=$("#cbxHdeHouse").attr("checked");
            AloneUserCode=$("#cbxAloneUserCode").attr("checked");
            ProtectedNum=$("#txtProtectedNum").attr("value");
            IsProtectMark=$("#cbxIsProtectMark").attr("checked");
            AllowPrivHouse=$("#cbxAllowPrivHouse").attr("checked");
            MarkProtectHours=$("#txtMarkProtectHours").attr("value");
            AllowPrivDemand=$("#cbxAllowPrivDemand").attr("checked");
            DefViewPubHouse=$("#cbxDefViewPubHouse").attr("checked");
            DefViewPrivHouse=$("#cbxDefViewPrivHouse").attr("checked");
            DefViewPubDemand=$("#cbxDefViewPubDemand").attr("checked");
            DefViewPrivDemand=$("#cbxDefViewPrivDemand").attr("checked");
            DefViewRealCustomer=$("#cbxDefViewRealCustomer").attr("checked");
            DefViewFakeCustomer=$("#cbxDefViewFakeCustomer").attr("checked");
            DefProtectPhone=$("#cbxDefProtectPhone").attr("checked");
            IsUseBlacklist=$("#cbxIsUseBlacklist").attr("checked");
            Level=$("input[name='rdoLevel']:checked").val();
            DefViewHideHouse=$("#cbxDefViewHideHouse").attr("checked");
            LockHouseDay=$("#txtLockHouseDay").attr("value");
            DefHasProtect=$("#cbxDefHasProtect").attr("checked");
            DepartId=$("#hdnDepartId").val(); //需要修改
            Type=$("#hdnType").val();
            
          urlstr = "../service/Test.ashx?OwnerNum=" + OwnerNum + "&HdeHouse=" + HdeHouse + "&AloneUserCode=" +AloneUserCode + "&ProtectedNum="+ProtectedNum+""+
                     "&IsProtectMark="+IsProtectMark+"&AllowPrivHouse="+AllowPrivHouse+"&MarkProtectHours="+MarkProtectHours+"&AllowPrivDemand="+AllowPrivDemand+""+
                     "&DefViewPubHouse="+DefViewPubHouse+"&DefViewPrivHouse="+DefViewPrivHouse+"&DefViewPubDemand="+DefViewPubDemand+"&DefViewPrivDemand="+DefViewPrivDemand+""+
                     "&DefViewRealCustomer="+DefViewRealCustomer+"&DefViewFakeCustomer="+DefViewFakeCustomer+"&DefProtectPhone="+DefProtectPhone+"&IsUseBlacklist="+IsUseBlacklist+"&Level="+Level+"&DefViewHideHouse="+DefViewHideHouse+"&LockHouseDay="+LockHouseDay+"&DefHasProtect="+DefHasProtect+"&DepartId="+DepartId+"&Type="+Type+" ";
      $.ajax({
          type: "get",
          url: urlstr,
          dataType: "json",          
          success: function(data) 
          {
              if (data.success == "1") 
              {
                  alert("提交成功");
              }
              else
              {
                 alert("提交失败");
              }
           
          },
          error:function(){
              alert("Error");
          }
      });
}

//关闭分配DIV
function allotclose() 
{
    //重置控件
    $("#txtOwnerNum").val("");
    $("#cbxHdeHouse").attr("checked",false);
    $("#cbxAloneUserCode").attr("checked",false);
    $("#txtProtectedNum").attr("value","");
    $("#cbxIsProtectMark").attr("checked",false);
    $("#cbxAllowPrivHouse").attr("checked",false);
    $("#txtMarkProtectHours").attr("value","");
    $("#cbxAllowPrivDemand").attr("checked",false);
    $("#cbxDefViewPubHouse").attr("checked",false);
    $("#cbxDefViewPrivHouse").attr("checked",false);
    $("#cbxDefViewPubDemand").attr("checked",false);
    $("#cbxDefViewPrivDemand").attr("checked",false);
    $("#cbxDefViewRealCustomer").attr("checked",false);
    $("#cbxDefViewFakeCustomer").attr("checked",false);
    $("#cbxDefProtectPhone").attr("checked",false);
    $("#cbxIsUseBlacklist").attr("checked",false);
    $("#rdoCompany").attr("checked", true);
    $("#rdoDePart").attr("checked", false);
    $("#rdoPerson").attr("checked", false);
    $("#cbxDefViewHideHouse").attr("checked",false);
    $("#txtLockHouseDay").attr("value","");
    $("#cbxDefHasProtect").attr("checked",false);
    $("#hdnDepartId").val("");
    $("#hdnType").val("");
    $("#houseallot").jqmHide();
}


function GetData(departId)
{
 $.ajax({
        type: "get",
        url: "../service/Test.ashx",
        data: "DepartId="+departId+"&IsView=1",
        dataType: "text",
        success: function(msg) 
        {
          var dataitems = eval(msg);
            if(dataitems[0]!=null)
            {
                $("#hdnType").val("Update");
                $("#hdnDepartId").val(dataitems[0].DepartId);
                $("#txtOwnerNum").val(dataitems[0].ViewOwnerNum);
                $("#txtLockHouseDay").val(dataitems[0].LockHouseDay);
                $("#txtProtectedNum").val(dataitems[0].ProtectedNum);
                $("#txtMarkProtectHours").val(dataitems[0].MarkProtectHours);
                $("#cbxHdeHouse").attr("checked",dataitems[0].IsHideHouse=="True"?true:false);
                $("#cbxAloneUserCode").attr("checked",dataitems[0].IsAloneUserCode=="True"?true:false);
                $("#cbxIsProtectMark").attr("checked",dataitems[0].IsProtectMark==="True"?true:false);
                $("#cbxAllowPrivHouse").attr("checked",dataitems[0].AllowPrivHouse==="True"?true:false);
                $("#cbxDefViewHideHouse").attr("checked",dataitems[0].DefViewHideHouse==="True"?true:false);
                $("#cbxAllowPrivDemand").attr("checked",dataitems[0].AllowPrivDemand==="True"?true:false);
                $("#cbxDefViewPubHouse").attr("checked",dataitems[0].DefViewPubHouse==="True"?true:false);
                $("#cbxDefViewPrivHouse").attr("checked",dataitems[0].DefViewPrivHouse=="True"?true:false);
                $("#cbxDefViewPubDemand").attr("checked",dataitems[0].DefViewPubDemand=="True"?true:false);
                $("#cbxDefViewPrivDemand").attr("checked",dataitems[0].DefViewPrivDemand=="True"?true:false);
                $("#cbxDefViewRealCustomer").attr("checked",dataitems[0].DefViewRealCustomer=="True"?true:false);
                $("#cbxDefViewFakeCustomer").attr("checked",dataitems[0].DefViewFakeCustomer=="True"?true:false);
                $("#cbxDefProtectPhone").attr("checked",dataitems[0].DefProtectPhone=="True"?true:false);
                $("#cbxIsUseBlacklist").attr("checked",dataitems[0].IsUseBlacklist="True"?true:false);
                if (dataitems[0].BlacklistLevel == '10') 
                {
                    $("#rdoCompany").attr("checked", true);
                } 
                else if (dataitems[0].BlacklistLevel == '20') 
                {
                    $("#rdoDePart").attr("checked", true);
                } 
                else if (dataitems[0].BlacklistLevel == '30') 
                {
                    $("#rdoPerson").attr("checked", true);
                }

            }
        }
    });
}
    
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <%--<div>
    <input type="text" style="ime-mode;" class="PNUM LEN10" />
    </div>
    
    <asp:FileUpload ID="FileUpload1" runat="server" />
    <img src="file:///C:/Users/Public/Pictures/Sample%20Pictures/Desert.jpg" />--%>
    <a href="#" id="abc">弹</a>
    <div class="jqmWindow" id="houseallot" style="width: 800px;">
        <div class="jqmTitle">
            <span class="title">房源设置</span><span class="jqmClose"></span></div>
        <div class="padding5">
            <input type="hidden" id="hdnDepartId" />
            <input type="hidden" id="hdnType" />
            每天查看电话数量限制
            <input type="text" id="txtOwnerNum" name="txtOwnerNum" style="width: 50px;" />(次)&nbsp;&nbsp;
            封盘最长有效期
            <input type="text" id="txtLockHouseDay" name="txtLockHouseDay" style="width: 50px;" />(天)
            &nbsp;&nbsp; 手动保护房源设定
            <input type="text" id="txtProtectedNum" name="txtProtectedNum" style="width: 50px;" />(套)&nbsp;&nbsp;
            保护时限
            <input type="text" id="txtMarkProtectHours" name="txtMarkProtectHours" style="width: 50px;" />(小时)
        </div>
        <br />
        <div class="padding5">
            该部门房源是否隐藏
            <input type="checkbox" id="cbxHdeHouse" name="cbxHdeHouse" />&nbsp;&nbsp; 是否单独工号序列
            <input type="checkbox" id="cbxAloneUserCode" name="cbxAloneUserCode" />&nbsp;&nbsp;
            是否对备案进行保护
            <input type="checkbox" id="cbxIsProtectMark" name="cbxIsProtectMark" />&nbsp;&nbsp;
            允许输入私盘
            <input type="checkbox" id="cbxAllowPrivHouse" name="cbxAllowPrivHouse" />&nbsp;&nbsp;
            是否可查看保护房源
            <input type="checkbox" id="cbxDefViewHideHouse" name="cbxDefViewHideHouse" />
        </div>
        <br />
        <div class="padding5">
            允许输入私客
            <input type="checkbox" id="cbxAllowPrivDemand" name="cbxAllowPrivDemand" />&nbsp;&nbsp;
            可查公盘
            <input type="checkbox" id="cbxDefViewPubHouse" name="cbxDefViewPubHouse" />&nbsp;&nbsp;
            可查私盘
            <input type="checkbox" id="cbxDefViewPrivHouse" name="cbxDefViewPrivHouse" />&nbsp;&nbsp;
            查看公客
            <input type="checkbox" id="cbxDefViewPubDemand" name="cbxDefViewPubDemand" />&nbsp;&nbsp;
            查看私客
            <input type="checkbox" id="cbxDefViewPrivDemand" name="cbxDefViewPrivDemand" />&nbsp;&nbsp;
            查看真业主信息
            <input type="checkbox" id="cbxDefViewRealCustomer" name="cbxDefViewRealCustomer" />&nbsp;&nbsp;
            查看假业主信息
            <input type="checkbox" id="cbxDefViewFakeCustomer" name="cbxDefViewFakeCustomer" />&nbsp;&nbsp;
        </div>
        <br />
        <div class="padding5">
            删除电话号码
            <input type="checkbox" id="cbxDefProtectPhone" name="cbxDefProtectPhone" />&nbsp;&nbsp;
            是否能保护房源
            <input type="checkbox" id="cbxDefHasProtect" name="cbxDefHasProtect" />&nbsp;&nbsp;
            是否使用黑名单过滤
            <input type="checkbox" id="cbxIsUseBlacklist" name="cbxIsUseBlacklist" />&nbsp;&nbsp;
            级别
            <input type="radio" id="rdoCompany" name="rdoLevel" value="10" checked="checked" />10:公司级；
            <input type="radio" id="rdoDePart" name="rdoLevel" value="20" />20:部门级；
            <input type="radio" id="rdoPerson" name="rdoLevel" value="30" />30:个人级；
        </div>
        <div style="float: right;">
            <a class="btn_n fl" href="javascript:allotsubmit();"><span>提交</span></a> <a class="btn_n fl"
                href="javascript:allotclose();"><span>关闭</span></a>
        </div>
    </div>
    </form>
</body>
<%--<script type="text/javascript">
 DcGlobal.getQueryString("aaa")
</script>--%>
</html>
